$(function() {
    
    $('a#edit').click(function() {
      $('#navigation li:nth-child(3) a').click();
      $td     = $(this).parent();
      $tr     = $td.parent();
      
      $id         = $tr.children('td:nth-child(1)').text();
      $login      = $tr.children('td:nth-child(2)').text();
      $name       = $tr.children('td:nth-child(3)').text();
      $email      = $tr.children('td:nth-child(4)').text();

      $('#log').val(jQuery.trim($login));
      $('#login').val(jQuery.trim($login));
      $('#email').val(jQuery.trim($email));
      $('#full_name').val(jQuery.trim($name));
      $('#admin_id').val(jQuery.trim($id));
      
    });
    
    $('#cancel').click(function(){
        $('#navigation li:nth-child(1) a').click();
    })
    
    $('#insert').click(function(){
        $('#navigation li:nth-child(2) a').click();
    })
    
    $('#cancel2').click(function(){
        $('#navigation li:nth-child(1) a').click();
    })
    
});